<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>

<body>
  <table border="1" cellspacing="0" cellpadding="0">

    <thead>

    <tr>

      <th>面试官</th>

      <th>求职者</th>

      <th>操作</th>
    </tr>

    </thead>

    <tbody></tbody>

  </table>
</body>
<script>

  var stus = ["郜志伟","李芸可","王楠楠","余遨","马英超","胡延啸","李卓毅","王献华","吴慧跃","韩政","裴天龙","毛利军","王琛舒","张总"];
  console.log(Math.floor(Math.random()*stus.length));


  function generateMixed() {
    var res="";
    for (var i = 0; i < stus.length; i++) {
      var id=Math.floor(Math.random()*13);
      res +=stus[id];
    }
    return res;
  }
  console.log(generateMixed());

  //数据写入

  var tbody = document.querySelector('tbody'); //找到tbody标签

  for (var i = 0; i < stus.length; i++) { //对stus进行循环遍历，并建立tr标签

    var tr = document.createElement('tr');

    tbody.appendChild(tr);

    for (var k in stus[i]) { //对假数据进行遍历

      var td = document.createElement('td'); //新建td

      td.innerHTML = stus[i][k]; //将对象数据写进td中

      tr.appendChild(td);

    }

    //删除按钮的建立

    var td = document.createElement('td');

    td.innerHTML = '删除';

    td.className = 'del'

    tr.appendChild(td);

  }





  //对'删除'进行点击事件

  var delClick = document.getElementsByClassName('del');

  for (var i = 0; i < delClick.length; i++) {
    delClick[i].onclick = function () {
      tbody.removeChild(this.parentNode);

    }

  }
</script>
<style>

  table th {
    width: 100px;

    height: 50px;

    border: 1px solid black;

  }

  td {
    color: green;

    text-align: center;

    border: 1px solid black;

    font-size: 18px;

  }

  .del{
    cursor: pointer;

  }

</style>
</html>